package com.timberwood.controller;

import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
import com.timberwood.model.dao.ProductDAO;
import com.timberwood.model.entity.Products;

@SuppressWarnings("serial")
public class ProductAction extends ActionSupport{
	
	private ProductDAO productDAO;

	
	public ProductAction() {
		productDAO = new ProductDAO();
	}
	
	//action của sản phẩm bán chạy
	private List<Products> salestproducts = null;
	public List<Products> getSalestproducts(){
		return salestproducts;
	}
	public String topSalestProduct() {
		salestproducts=productDAO.sleSalestProducts();
		return SUCCESS;
	}
	
	
	//action của sản phẩm mới
	private List<Products> newstProducts = null;
	
	public List<Products> getNewstProducts() {
		return newstProducts;
	}
	public String topNewsProduct() {
		newstProducts=productDAO.sleNewsProducts();
		return SUCCESS;
	}
	
	
	private List<Products> listProduct = null;


	public List<Products> getListProduct() {
		return listProduct;
	}
	
	public String proBusyA() {
		listProduct=productDAO.proBusyA();
		return SUCCESS;
	}
	
	public String proStopSellingA() {
		listProduct=productDAO.proStopSellingA();
		return SUCCESS;
	}
	
	

	
}
